package model;

import java.io.Serializable;
import javax.persistence.*;

/**
 * The primary key class for the hotel database table.
 * 
 */
@Embeddable
public class HotelPK implements Serializable {
	//default serial version id, required for serializable classes.
	private static final long serialVersionUID = 1L;

	@Column(name="id_hotel")
	private int idHotel;

	@Temporal(TemporalType.DATE)
	private java.util.Date data;

	public HotelPK() {
	}
	public int getIdHotel() {
		return this.idHotel;
	}
	public void setIdHotel(int idHotel) {
		this.idHotel = idHotel;
	}
	public java.util.Date getData() {
		return this.data;
	}
	public void setData(java.util.Date data) {
		this.data = data;
	}

	public boolean equals(Object other) {
		if (this == other) {
			return true;
		}
		if (!(other instanceof HotelPK)) {
			return false;
		}
		HotelPK castOther = (HotelPK)other;
		return 
			(this.idHotel == castOther.idHotel)
			&& this.data.equals(castOther.data);
	}

	public int hashCode() {
		final int prime = 31;
		int hash = 17;
		hash = hash * prime + this.idHotel;
		hash = hash * prime + this.data.hashCode();
		
		return hash;
	}
}